<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .a{
            width: 100px;
            height: 100px;
            background-color: #000;
            position: absolute;
        }
    </style>
</head>
<body>

    <div class="a"></div>

    <script>


        // 匀加速运动

        var oA = document.querySelector('.a') ;
        move(oA , 1 , 1100)

        function move(ele , speed , end) {
            var x = ele.offsetLeft ;
            var t = setInterval(function(){
                speed+=4 ;
                x += speed ;
                ele.style.left = x + 'px' ;
                if(x >= end) {
                    clearInterval(t) ;
                }
            } , 20)
        }

    </script>
    
</body>
</html>